import { axios } from '@/utils/request'

const api = {
    leadingPage: '/admin/member-leading/page',

    recordPage: '/admin/member-contacts-unlock-record/page',
    cooperationPage: '/admin/member-contacts-unlock-record/cooperation/page',
    recordDetail: '/admin/member-contacts-unlock-record/getById/',
    innerReview: '/admin/member-contacts-unlock-record/review',

    outReview: '/admin/member-contacts-unlock-record/cooperation/review',

    configInfo: '/admin/connectionConfig/getTenantInfo',
    configUpdate: '/admin/connectionConfig/save',
    managerList: '/admin/connectionManager/getManagerList',
    managerAddByType: '/admin/connectionManager/addByType',
    managerDel: '/admin/connectionManager/del/',

    /** 会外配置相关 */
    tenantInfo: '/admin/cooperationResourceConfig/getTenantInfo',
    tenantSave: '/admin/cooperationResourceConfig/tenantSave',
    /**供需配置相关*/
    getBoPlatformTypeConfigList: '/admin/bo-platform-type-config/list',
    /**供需管理员配置*/
    boPlatformTypeConfigAddOrUpdate: '/admin/bo-platform-type-config/addOrUpdate'
}

export default api

/**
* 人脉列表
*/
export function LeadingPage(data) {
    return axios({
        url: api.leadingPage,
        method: 'post',
        data
    })
}

/**
* 会内人脉审核列表
*/
export function RecordPage(params) {
    return axios({
        url: api.recordPage,
        method: 'get',
        params
    })
}

/**
* 会外人脉审核列表
*/
export function CooperationPage(params) {
    return axios({
        url: api.cooperationPage,
        method: 'get',
        params
    })
}

/**
* 获取详情
*/
export function RecordDetail(id) {
    return axios({
        url: api.recordDetail + id,
        method: 'get',
    })
}

/**
* 会内审核
*/
export function InnerReview(data) {
    return axios({
        url: api.innerReview,
        method: 'post',
        data
    })
}

/**
* 会外审核
*/
export function OutReview(data) {
    return axios({
        url: api.outReview,
        method: 'post',
        data
    })
}

/**
* 获取人脉配置
*/
export function ConfigInfo() {
    return axios({
        url: api.configInfo,
        method: 'get'
    })
}

/**
* 变更人脉配置
*/
export function ConfigUpdate(data) {
    return axios({
        url: api.configUpdate,
        method: 'post',
        data
    })
}

/**
* 查询审批人
*/
export function ManagerList() {
    return axios({
        url: api.managerList,
        method: 'get',
    })
}

/**
* 添加审批人
*/
export function ManagerAdd(data) {
    return axios({
        url: api.managerAddByType,
        method: 'post',
        data
    })
}

/**
* 删除审批人
*/
export function ManagerDel(id) {
    return axios({
        url: api.managerDel + id,
        method: 'get',
    })
}

/**
* 查看合作资源
*/
export function TenantInfo() {
    return axios({
        url: api.tenantInfo,
        method: 'get',
    })
}


/**
* 保存合作资源
*/
export function TenantSave(data) {
    return axios({
        url: api.tenantSave,
        method: 'post',
        data
    })
}

/**
 * 获取供需配置列表
 * @returns 
 */
export function getBoPlatformTypeConfigList() {
    return axios({
        url: api.getBoPlatformTypeConfigList,
        method: 'get',
    })
}

/**
 * 获取供需管理员配置列表
 * @param {*} data 
 * @returns 
 */
export function boPlatformTypeConfigAddOrUpdate(data) {
    return axios({
        url: api.boPlatformTypeConfigAddOrUpdate,
        method: 'post',
        data
    })
}


